package com.xuecheng.content.controller.api;

import com.xuecheng.content.model.po.CourseCategory;
import com.xuecheng.content.model.vo.CourseCategoryTreeVo;
import com.xuecheng.content.service.CourseCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 课程分类 前端控制器
 * </p>
 *
 * @author itcast
 */
@Slf4j
@RestController
@RequestMapping("course-category")
@Api(tags = "课程分类相关接口")
public class CourseCategoryController {

    @Autowired
    private CourseCategoryService  courseCategoryService;


    @GetMapping("/tree-nodes")
    @ApiOperation("获取课程分类树形结构")
    public List<CourseCategoryTreeVo> getTreeNodes(){
        return courseCategoryService.getTree();

    }

}
